package com.kaifamiao.demo.d0801.factory;

public abstract class HumanMethodFactory {

//    abstract Human createHuman();

    abstract Man createMan();

    abstract Woman createWoman();
}

class BlackHumanFactory extends HumanMethodFactory {

//    @Override
//    Human createHuman() {
//        return new BlackHuman();
//    }

    @Override
    Man createMan() {
        return new BlackMan();
    }

    @Override
    Woman createWoman() {
        return new BlackWoman();
    }
}

class WhiteHumanFactory extends HumanMethodFactory {
    @Override
    Man createMan() {
        return new WhiteMan();
    }

    @Override
    Woman createWoman() {
        return new WhiteWoman();
    }

//    @Override
//    Human createHuman() {
//        return new WhiteHuman();
//    }
}

abstract class ChineseFactory extends HumanMethodFactory{

//    @Override
//    Human createHuman() {
//        return new Chinese();
//    }
}

abstract class GreenHumanFactory extends HumanMethodFactory {
//    @Override
//    Human createHuman() {
//        return new GreenHuman();
//    }
}
